/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.gis.service.dto;

import com.alibaba.fastjson.JSONArray;
import lombok.Data;
import me.zhengjie.base.BaseDTO;

import java.sql.Timestamp;
import java.math.BigDecimal;
import java.io.Serializable;
import java.util.List;

/**
* @website https://el-admin.vip
* @description /
* @author ZhuangBing Yan
* @date 2022-08-15
**/
@Data
public class FeedHistoryDto extends BaseDTO implements Serializable {

    /** 主键ＩＤ */
    private Long id;

    /** 车牌号 */
    private String carNumber;

    /** 卡号 */
    private String cardNumber;

    /** 货物名称 */
    private String goodName;

    /** 发货单位 */
    private String deliverCompany;

    /** 区域 */
    private String area;

    /** 运输单位 */
    private String feedCompany;

    /** 处置单位 */
    private String disposeCompany;

    /** 毛重（吨） */
    private BigDecimal grossWeight;

    /** 皮重(吨) */
    private BigDecimal tareWeight;

    /** 扣减(吨) */
    private BigDecimal deductionWeight;

    /** 净重(吨) */
    private BigDecimal netWeight;


    /** 车间名称 */
    private String workShopName;

    /** 数据类型() */
    private Integer type;

    /** 数据状态 */
    private Integer status;

    /** 是否删除( 0 未删除  1 已删除) */
    private Boolean isDel;

    /** 进厂时间 */
    private Timestamp enterInTime;

    /** 起点经度坐标 */
    private BigDecimal positionStartLat;

    /** 起点纬度坐标 */
    private BigDecimal positionStartLng;

    /** 路经线坐标 */
    private String linePosition;

    /** 终点经度坐标 */
    private BigDecimal positionEndLat;

    /** 终点纬度坐标 */
    private BigDecimal positionEndLng;

    /**
     *
     * @return 起点经纬度
     */
    public String getOrigin(){
        return this.positionStartLng+","+this.positionStartLat;
    }

    /**
     *
     * @return 目的地经纬度
     */
    public String getDestination(){
        return this.positionEndLng+","+this.positionEndLat;
    }

    public List<BigDecimal[]> getPoline(){
        return JSONArray.parseArray(this.linePosition,BigDecimal[].class);
    }

}